package com.blindnews.controller;


import com.blindnews.pojo.Result;
import com.blindnews.pojo.User;
import com.blindnews.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
public class UserController {
    @Autowired
    private UserService userService;


   @GetMapping ("/users")
    public Result list(){
       log.info("查询全部信息");
       List<User> userList= userService.list();
       return Result.success("成功",userList);
   }
}
